import { Controller, Get, Param, UseGuards } from '@nestjs/common';
import { PersonaService } from './persona.service';
import { ApiBearerAuth, ApiOperation, ApiTags } from '@nestjs/swagger';
import { JwtAuthGuard } from '../auth/guards/jwt-auth.guard';

@ApiTags('Persona')
@ApiBearerAuth()
@UseGuards(JwtAuthGuard)
@Controller('personas')
export class PersonaController {
  constructor(private readonly personaService: PersonaService) {}

  // Get persona list
  @Get()
  @ApiOperation({ summary: 'Get Persona list' })
  async list() {
    return this.personaService.listActive();
  }

  // Get persona details
  @Get(':id')
  @ApiOperation({ summary: 'Get Persona details' })
  async detail(@Param('id') id: string) {
    return this.personaService.getById(id);
  }
}